#ifndef COMMANDHANLER_H_H_H_H_
#define COMMANDHANLER_H_H_H_H_


class CommandHandler
{
public:
	CommandHandler(const char* CommandName);
	virtual~CommandHandler(void);


	virtual void excuteCommand(const char* v = "") = 0;	
protected:


 private:
	std::string _commandName;

};

 class openFileCommand : public CommandHandler
 {
 public:
 	openFileCommand(const char* commandName);
 public:
 	void excuteCommand(const char* v = "");
 };

 class saveFileCommand : public CommandHandler
 {
 public:
 	saveFileCommand(const char* commandName);
 	
 public:
 	void excuteCommand(const char* v = "");
 };

 class setLabelCommand : public CommandHandler
 {
 public:
	 setLabelCommand(const char* commandName);
 public:
	 void excuteCommand(const char* v = "");
 };

 class setFileNameCommand: public CommandHandler
 {
 public:
	 setFileNameCommand(const char* commandName);
 public:
	 void excuteCommand(const char* v = "");
 };

 class CommandHandlerManager
 {
 public:
	 CommandHandlerManager();
	 ~CommandHandlerManager();

	 void initCommandHandler();

	 void excuteCommandByName(const char*,const char* value = 0);

	 void addCommand(const char*CommandName,CommandHandler* handler);
	 void removeCommand(CommandHandler* handler);
	 void removeCommand(const char*);
	 void clear();

	 CommandHandler* getCommand(const char* name)const;


 public:
	 static CommandHandlerManager* _instance;
	 static CommandHandlerManager* getSingleton();

 private:

	 std::map<std::string,CommandHandler*> _commandList;

 };
#endif